<?php
namespace Admin\Controller;

use Think\Controller;
class ComController extends Controller
{
   
     public function _initialize(){
         checkLogin();
        $admin = checkadmin();
        $this->assign('admin', $admin);
     }
     
     public function jpusher($title,$conent,$extras=null) {
        import('Org.Util.JPusher');
        $jpusher = new \JPusher('8f823057b8df49af41fb5fa2','dca3b0e35cdd849738885fc3');
        try {
            $ret = $jpusher->push($title,$conent,$extras);
//             dump($ret);
            return true;
        } catch (\Exception $e) {
//             dump($e);
        }
     }
     
     public function params($filters = 'htmlspecialchars') {
         $data = I('param.');
         return $data;
     }
     
     public function response($code='',$message=true,$extra='') {
         $data = [
             'code'=>$code,
             'message'=>$message,
             'data'=>$extra
         ];
        echo json_encode($data);
     }
     
}